import request from '@/utils/request'

// 查询拼团管理列表
export function listGroupbuying(query) {
  return request({
    url: '/market/groupbuying/list',
    method: 'get',
    params: query
  })
}

// 查询拼团管理列表
export function groupbuyList(query) {
  return request({
    url: '/market/groupbuying/groupbuyList',
    method: 'get',
    params: query
  })
}

// 查询拼团管理详细
export function getGroupbuying(id) {
  return request({
    url: '/market/groupbuying/' + id,
    method: 'get'
  })
}

// 新增拼团管理
export function addGroupbuying(data) {
  return request({
    url: '/market/groupbuying',
    method: 'post',
    data: data
  })
}

// 修改拼团管理
export function updateGroupbuying(data) {
  return request({
    url: '/market/groupbuying',
    method: 'put',
    data: data
  })
}

// 删除拼团管理
export function delGroupbuying(id) {
  return request({
    url: '/market/groupbuying/' + id,
    method: 'delete'
  })
}
// 状态修改
export function changeGroupbuyingStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/market/groupbuying/changeStatus',
    method: 'put',
    data: data
  })
}
